import { http } from "@/utils/http";
import { resolve } from "path";

type Result = {
  data: Array<any>;
};

export const getAsyncRoutes = () => {
    return http.request<Result>("get", "/api/getRouters");
//   return new Promise(resolve => {
//     setTimeout(() => {
//       resolve(data);
//     }, 1000);
//   });
};
const data = {
    "msg": "操作成功",
    "code": 200,
    "data": [
        {
            "name": "Contract",
            "path": "/contract",
            "hidden": false,
            "redirect": "noRedirect",
            "component": "Layout",
            "alwaysShow": true,
            "meta": {
                "title": "合 同 管 理",
                "icon": "education",
                "noCache": false
            },
            "children": [
                {
                    "name": "MerchantsContract",
                    "path": "/contract/merchantsContract",
                    "hidden": false,
                    "component": "contract/merchantsContract",
                    "meta": {
                        "title": "公司合同",
                        "icon": "clipboard",
                        "noCache": false
                    }
                },
                {
                    "name": "AverageUserContract",
                    "path": "/contract/averageUserContract",
                    "hidden": false,
                    "component": "contract/averageUserContract",
                    "meta": {
                        "title": "自由职业者合同",
                        "icon": "clipboard",
                        "noCache": false
                    }
                },
                {
                    "name": "BankAccountContract",
                    "path": "/contract/bankAccountContract",
                    "hidden": false,
                    "component": "contract/bankAccountContract",
                    "meta": {
                        "title": "银行支付合同",
                        "icon": "clipboard",
                        "noCache": false
                    }
                },
                {
                    "name": "MerchantsNormConfirm",
                    "path": "/contract/merchantsNormConfirm",
                    "hidden": false,
                    "component": "contract/merchantsNormConfirm",
                    "meta": {
                        "title": "规范确认记录",
                        "icon": "clipboard",
                        "noCache": false
                    }
                }
            ]
        },
        {
            "name": "ProjectManage",
            "path": "/projectManage",
            "hidden": false,
            "redirect": "noRedirect",
            "component": "Layout",
            "alwaysShow": true,
            "meta": {
                "title": "项 目 管 理",
                "icon": "swagger",
                "noCache": false
            },
            "children": [
                {
                    "name": "Project",
                    "path": "/projectManage/project",
                    "hidden": false,
                    "component": "projectManage/project",
                    "meta": {
                        "title": "项目记录",
                        "icon": "list",
                        "noCache": false
                    }
                },
                {
                    "name": "Task",
                    "path": "/projectManage/task",
                    "hidden": false,
                    "component": "projectManage/task",
                    "meta": {
                        "title": "任务列表",
                        "icon": "nested",
                        "noCache": false
                    }
                }
            ]
        },
        {
            "name": "Business",
            "path": "/business",
            "hidden": false,
            "redirect": "noRedirect",
            "component": "Layout",
            "alwaysShow": true,
            "meta": {
                "title": "业 务 管 理",
                "icon": "online",
                "noCache": false
            },
            "children": [
                {
                    "name": "Voucher",
                    "path": "/business/voucher",
                    "hidden": false,
                    "component": "business/voucher",
                    "meta": {
                        "title": "验收单",
                        "icon": "build",
                        "noCache": false
                    }
                },
                {
                    "name": "Settle",
                    "path": "/business/settle",
                    "hidden": false,
                    "component": "business/settle",
                    "meta": {
                        "title": "完税凭证",
                        "icon": "clipboard",
                        "noCache": false
                    }
                }
            ]
        },
        {
            "name": "InvoiceManage",
            "path": "/invoiceManage",
            "hidden": false,
            "redirect": "noRedirect",
            "component": "Layout",
            "alwaysShow": true,
            "meta": {
                "title": "发 票 管 理",
                "icon": "clipboard",
                "noCache": false
            },
            "children": [
                {
                    "name": "Record",
                    "path": "/invoiceManage/record",
                    "hidden": false,
                    "component": "invoiceManage/record",
                    "meta": {
                        "title": "开票记录",
                        "icon": "dict",
                        "noCache": false,
                         "showParent": true,
                    }
                }
            ]
        },
        {
            "name": "CapitalManage",
            "path": "/capitalManage",
            "hidden": false,
            "redirect": "noRedirect",
            "component": "Layout",
            "alwaysShow": true,
            "meta": {
                "title": "资 金 管 理",
                "icon": "money",
                "noCache": false
            },
            "children": [
                {
                    "name": "Record",
                    "path": "/capitalManage/grant",
                    "hidden": false,
                    "component": "capitalManage/grant",
                    "meta": {
                        "title": "发放记录",
                        "icon": "fullscreen",
                        "noCache": false
                    }
                },
                {
                    "name": "Refund",
                    "path": "/capitalManage/refund",
                    "hidden": false,
                    "component": "capitalManage/refund",
                    "meta": {
                        "title": "退款单",
                        "icon": "edit",
                        "noCache": false
                    }
                },
                {
                    "name": "Account",
                    "path": "capitalManage/account",
                    "hidden": false,
                    "component": "capitalManage/account",
                    "meta": {
                        "title": "账户管理",
                        "icon": "number",
                        "noCache": false
                    }
                },
                {
                    "name": "Grant",
                    "path": "/capitalManage/grant",
                    "hidden": false,
                    "component": "capitalManage/grant",
                    "meta": {
                        "title": "发放明细",
                        "icon": "fullscreen",
                        "noCache": false
                    }
                },
                {
                    "name": "Recharge",
                    "path": "/capitalManage/recharge",
                    "hidden": false,
                    "component": "capitalManage/recharge",
                    "meta": {
                        "title": "充值记录",
                        "icon": "exit-fullscreen",
                        "noCache": false
                    }
                }
            ]
        },
        {
            "name": "InvoiceTax",
            "path": "/invoiceTax",
            "hidden": false,
            "redirect": "noRedirect",
            "component": "Layout",
            "alwaysShow": true,
            "meta": {
                "title": "开 票 管 理",
                "icon": "form",
                "noCache": false
            },
            "children": [
                {
                    "name": "Query",
                    "path": "/invoiceTax/query",
                    "hidden": false,
                    "component": "invoiceTax/query",
                    "meta": {
                        "title": "查询",
                        "icon": "search",
                        "noCache": false
                    }
                },
                {
                    "name": "Record",
                    "path": "/invoiceTax/record",
                    "hidden": false,
                    "component": "invoiceTax/record",
                    "meta": {
                        "title": "开票",
                        "icon": "nested",
                        "noCache": false
                    }
                }
            ]
        }
    ]
}
